<?php

use Illuminate\Support\Facades\Route;
use Illuminate\Http\Request;
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/user/add', 'App\Http\Controllers\UserController@add');
Route::post('/user/store', 'App\Http\Controllers\UserController@store');
Route::get('/user/index', 'App\Http\Controllers\UserController@index');
Route::get('/user/edit/{id}', 'App\Http\Controllers\UserController@edit');
Route::post('/user/update', 'App\Http\Controllers\UserController@update');
Route::get('/user/del/{id}', 'App\Http\Controllers\UserController@del');

Route::get('/', function () {
    return view('welcome');
});

Route::get('/greeting', function () {
    return view('greeting', ['name' => 'James']);
});

Route::get('/user', function (Request $request) {
    return response()
            ->json(['name' => 'Abigail', 'state' => 'CA'])
            ->withCallback($request->input('callback'));
});
